/**
 * Created by evantang on 2018/3/29.
 */
import {Pipe, PipeTransform} from "@angular/core";

@Pipe({name: 'processStatus'})
export class ProcessStatusPipe implements PipeTransform {
  transform(value: string, args: string[]): any {
    if (value.includes('finished')) {
      if (value.includes('startCheck') && !value.includes('startCheckComplete')) {
        return '排查\n完成';
      } else if (value.includes('startCheckComplete')) {
        return '初查\n完成';
      } else if (value.includes('hospitalModify')) {
        return '整改\n完成';
      } else if (value.includes('recheck')) {
        return '复查\n完成';
      } else {
        return '完成';
      }
    } else {
      if (value.includes('startCheck') && !value.includes('startCheckComplete')) {
        return '初查';
      } else if (value.includes('startCheckComplete')) {
        return '初查中';
      } else if (value.includes('hospitalModify')) {
        return '整改中';
      } else if (value.includes('recheck')) {
        return '复查中';
      }
    }

    return '--';
  }
}
